Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Defining a browse

This section describes some of the major functionality and style choices available when you define a browse, and the issues involved with those choices.

You can browse records by defining a browse for the query and opening the query. If you do not specifically enable the browse columns, the result is a read-only browse. Once the user finds and selects a record, your application can use the selected record, which the associated query puts in one or more associated buffers. This is the general syntax for a browse definition:

DEFINE BROWSE browse-name QUERY query-name  
   [ SHARE-LOCK | EXCLUSIVE-LOCK | NO-LOCK ]  
   DISPLAY   { column-list | record [ EXCEPT field ... ] }  
   [ browse-enable-phrase ] browse-options-phrase . 

As with all objects you define, you first give the browse a name. Next, you associate it with a query that you have previously defined. You can later associate the browse with a different query at run time by setting its QUERY attribute, but the query it’s defined for is the source of initial information about the buffers and fields you use to define columns in the browse.

Once again, NO-LOCK is the only reasonable locking option even for a browse on a database table and the only possible one for a browse on a temp-table, since temp-table don’t support record locking. It’s also the default, so you can leave out the NO-LOCK keyword altogether.

The DISPLAY phrase tells Progress which fields from the buffers in the query to display as columns in the browse. You can specify either an explicit space-delimited column-list or a list of one or more record buffers from the query. In the latter case, you can use the EXCEPT phrase to remove one or more fields from each record when it is displayed. The default is not to display any fields at all, so you must always include a DISPLAY phrase in your browse definition unless you want to define all the columns at run time, as you will learn to do in Chapter 20, " Creating and Using Dynamic Temp-tables and Browses."

If you just specify the DISPLAY list, the browse is read-only. None of its cells are enabled for input. The browse-enable-phrase lets you enable one or more cells for input:

ENABLE { column . . . | ALL [ EXCEPT column . . .] } 

Each column in the ENABLE phrase must be a column in the DISPLAY list. If you want to enable all or almost all the columns, you can use the ALL keyword optionally followed by an EXCEPT list.

There are many options you can specify in the browse-options-phrase to customize the appearance and behavior of your browse. The phrase begins with the WITH keyword. Here are some of the more important options:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095